package com.haizhi.crm.api.controller.sys.auth;

import com.haizhi.crm.common.model.Response;
import com.haizhi.crm.sys.auth.model.PositionQo;
import com.haizhi.crm.sys.auth.service.PositionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * Created by yangyijun on 2018/5/17.
 */
@Api(description = "[系统-岗位]" )
@RestController
@RequestMapping("/auth/position" )
public class PositionController {

    @Autowired
    private PositionService positionService;

    @GetMapping("/findAll" )
    @ApiOperation(value = "查询所有岗位" )
    public Response findAll() {
        return positionService.findAll();
    }

    @PostMapping("/import" )
    @ApiOperation(value = "行内岗位信息表数据导入接口" )
    public Response save(@RequestBody @Valid PositionQo positionQo) {
        return positionService.save(positionQo);
    }

}
